﻿<%@ Page Title="" Language="C#" MasterPageFile="~/admin/admin.master" AutoEventWireup="true" CodeFile="view-request.aspx.cs" Inherits="admin_admins_view_request" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="mainContent" Runat="Server">
    <div class="page-header">
        <h1>ACS Requests <small>view request</small></h1>
    </div>
<div class="span5">
    <asp:FormView ID="FormView1" runat="server" DataKeyNames="ID" DataSourceID="SqlDataSource1" 
        Width="50%">
        <EditItemTemplate>
            ID:
            <asp:Label ID="IDLabel1" runat="server" Text='<%# Eval("ID") %>' />
            <br />
            ACS_NAME:
            <asp:TextBox ID="ACS_NAMETextBox" runat="server" Text='<%# Bind("ACS_NAME") %>' />
            <br />
            UNI_ID:
            <asp:TextBox ID="UNI_IDTextBox" runat="server" Text='<%# Bind("UNI_ID") %>' />
            <br />
            CONTACT_NAME:
            <asp:TextBox ID="CONTACT_NAMETextBox" runat="server" Text='<%# Bind("CONTACT_NAME") %>' />
            <br />
            CONTACT_EMAIL:
            <asp:TextBox ID="CONTACT_EMAILTextBox" runat="server" Text='<%# Bind("CONTACT_EMAIL") %>' />
            <br />
            CONTACT_NUMBER:
            <asp:TextBox ID="CONTACT_NUMBERTextBox" runat="server" Text='<%# Bind("CONTACT_NUMBER") %>' />
            <br />
            REQUEST_DATE:
            <asp:TextBox ID="REQUEST_DATETextBox" runat="server" Text='<%# Bind("REQUEST_DATE") %>' />
            <br />
            APPROVED:
            <asp:CheckBox ID="APPROVEDCheckBox" runat="server" Checked='<%# Bind("APPROVED") %>' />
            <br />
            USERNAME:
            <asp:TextBox ID="USERNAMETextBox" runat="server" Text='<%# Bind("USERNAME") %>' />
            <br />
            POSITION:
            <asp:TextBox ID="POSITIONTextBox" runat="server" Text='<%# Bind("POSITION") %>' />
            <br />
            UNIVERISTY_NAME:
            <asp:TextBox ID="UNIVERISTY_NAMETextBox" runat="server" Text='<%# Bind("UNIVERISTY_NAME") %>' />
            <br />
            <asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True" CommandName="Update" 
                Text="Update" />
            &nbsp;<asp:LinkButton ID="UpdateCancelButton" runat="server" CausesValidation="False" 
                CommandName="Cancel" Text="Cancel" />
        </EditItemTemplate>
        <InsertItemTemplate>
            ACS_NAME:
            <asp:TextBox ID="ACS_NAMETextBox" runat="server" Text='<%# Bind("ACS_NAME") %>' />
            <br />
            UNI_ID:
            <asp:TextBox ID="UNI_IDTextBox" runat="server" Text='<%# Bind("UNI_ID") %>' />
            <br />
            CONTACT_NAME:
            <asp:TextBox ID="CONTACT_NAMETextBox" runat="server" Text='<%# Bind("CONTACT_NAME") %>' />
            <br />
            CONTACT_EMAIL:
            <asp:TextBox ID="CONTACT_EMAILTextBox" runat="server" Text='<%# Bind("CONTACT_EMAIL") %>' />
            <br />
            CONTACT_NUMBER:
            <asp:TextBox ID="CONTACT_NUMBERTextBox" runat="server" Text='<%# Bind("CONTACT_NUMBER") %>' />
            <br />
            REQUEST_DATE:
            <asp:TextBox ID="REQUEST_DATETextBox" runat="server" Text='<%# Bind("REQUEST_DATE") %>' />
            <br />
            APPROVED:
            <asp:CheckBox ID="APPROVEDCheckBox" runat="server" Checked='<%# Bind("APPROVED") %>' />
            <br />
            USERNAME:
            <asp:TextBox ID="USERNAMETextBox" runat="server" Text='<%# Bind("USERNAME") %>' />
            <br />
            POSITION:
            <asp:TextBox ID="POSITIONTextBox" runat="server" Text='<%# Bind("POSITION") %>' />
            <br />
            UNIVERISTY_NAME:
            <asp:TextBox ID="UNIVERISTY_NAMETextBox" runat="server" Text='<%# Bind("UNIVERISTY_NAME") %>' />
            <br />
            <asp:LinkButton ID="InsertButton" runat="server" CausesValidation="True" CommandName="Insert" 
                Text="Insert" />
            &nbsp;<asp:LinkButton ID="InsertCancelButton" runat="server" CausesValidation="False" 
                CommandName="Cancel" Text="Cancel" />
        </InsertItemTemplate>
        <ItemTemplate>
            <strong>ACS NAME:</strong>
            <br />
            <asp:Label ID="ACS_NAMELabel" runat="server" Text='<%# Bind("ACS_NAME") %>' />
            <br />
            <br />
            <strong>UNIVERISTY:</strong>
            <br />
            <asp:Label ID="UNIVERISTY_NAMELabel" runat="server" Text='<%# Bind("UNIVERISTY_NAME") %>' />
            <br />
            <br />
            <strong>CONTACT NAME:</strong>
            <br />
            <asp:Label ID="CONTACT_NAMELabel" runat="server" Text='<%# Bind("CONTACT_NAME") %>' />
            <br />
            <br />
            <strong>CONTACT EMAIL:</strong>
            <br />
            <asp:Label ID="CONTACT_EMAILLabel" runat="server" Text='<%# Bind("CONTACT_EMAIL") %>' />
            <br />
            <br />
            <strong>CONTACT NUMBER:</strong>
            <br />
            <asp:Label ID="CONTACT_NUMBERLabel" runat="server" Text='<%# Bind("CONTACT_NUMBER") %>' />
            <br />
            <br />
            <strong>POSITION:</strong><br />
            <asp:Label ID="POSITIONLabel" runat="server" Text='<%# Bind("POSITION") %>' />
            <br />
            <br />
            <strong>REQUEST DATE:</strong>
            <br />
            <asp:Label ID="REQUEST_DATELabel" runat="server" Text='<%# Bind("REQUEST_DATE") %>' />
            <br />
            <br />

            &nbsp;<asp:LinkButton ID="DeleteButton" runat="server" CausesValidation="False" CommandName="Delete" 
                Text="Delete" CssClass="btn btn-danger" ><i class="icon-remove"></i> Delete Request</asp:LinkButton>
            &nbsp;
        </ItemTemplate>
    </asp:FormView>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:ApplicationServices %>" 
        DeleteCommand="DELETE FROM [ADMIN_REQUEST] WHERE [ID] = @ID" 
        InsertCommand="INSERT INTO [ADMIN_REQUEST] ([ACS_NAME], [UNI_ID], [CONTACT_NAME], [CONTACT_EMAIL], [CONTACT_NUMBER], [REQUEST_DATE], [APPROVED], [USERNAME], [POSITION]) VALUES (@ACS_NAME, @UNI_ID, @CONTACT_NAME, @CONTACT_EMAIL, @CONTACT_NUMBER, @REQUEST_DATE, @APPROVED, @USERNAME, @POSITION)" 
        SelectCommand="SELECT ADMIN_REQUEST.ID, ADMIN_REQUEST.ACS_NAME, ADMIN_REQUEST.UNI_ID, ADMIN_REQUEST.CONTACT_NAME, ADMIN_REQUEST.CONTACT_EMAIL, ADMIN_REQUEST.CONTACT_NUMBER, ADMIN_REQUEST.REQUEST_DATE, ADMIN_REQUEST.APPROVED, ADMIN_REQUEST.USERNAME, ADMIN_REQUEST.POSITION, UNIVERSITIES.UNIVERISTY_NAME FROM ADMIN_REQUEST INNER JOIN UNIVERSITIES ON ADMIN_REQUEST.ID = UNIVERSITIES.ID WHERE (ADMIN_REQUEST.ID = @ID)" 
        UpdateCommand="UPDATE [ADMIN_REQUEST] SET [ACS_NAME] = @ACS_NAME, [UNI_ID] = @UNI_ID, [CONTACT_NAME] = @CONTACT_NAME, [CONTACT_EMAIL] = @CONTACT_EMAIL, [CONTACT_NUMBER] = @CONTACT_NUMBER, [REQUEST_DATE] = @REQUEST_DATE, [APPROVED] = @APPROVED, [USERNAME] = @USERNAME, [POSITION] = @POSITION WHERE [ID] = @ID">
        <DeleteParameters>
            <asp:Parameter Name="ID" Type="Int32" />
        </DeleteParameters>
        <InsertParameters>
            <asp:Parameter Name="ACS_NAME" Type="String" />
            <asp:Parameter Name="UNI_ID" Type="Int32" />
            <asp:Parameter Name="CONTACT_NAME" Type="String" />
            <asp:Parameter Name="CONTACT_EMAIL" Type="String" />
            <asp:Parameter Name="CONTACT_NUMBER" Type="String" />
            <asp:Parameter Name="REQUEST_DATE" Type="DateTime" />
            <asp:Parameter Name="APPROVED" Type="Boolean" />
            <asp:Parameter Name="USERNAME" Type="String" />
            <asp:Parameter Name="POSITION" Type="String" />
        </InsertParameters>
        <SelectParameters>
            <asp:QueryStringParameter Name="ID" QueryStringField="id" Type="Int32" />
        </SelectParameters>
        <UpdateParameters>
            <asp:Parameter Name="ACS_NAME" Type="String" />
            <asp:Parameter Name="UNI_ID" Type="Int32" />
            <asp:Parameter Name="CONTACT_NAME" Type="String" />
            <asp:Parameter Name="CONTACT_EMAIL" Type="String" />
            <asp:Parameter Name="CONTACT_NUMBER" Type="String" />
            <asp:Parameter Name="REQUEST_DATE" Type="DateTime" />
            <asp:Parameter Name="APPROVED" Type="Boolean" />
            <asp:Parameter Name="USERNAME" Type="String" />
            <asp:Parameter Name="POSITION" Type="String" />
            <asp:Parameter Name="ID" Type="Int32" />
        </UpdateParameters>
    </asp:SqlDataSource>
    </div>
    <div class="span3">
        <h3>Assign login</h3>
        <asp:DropDownList ID="DropDownList1" runat="server">
        </asp:DropDownList>
        <br />
        <asp:LinkButton ID="LinkButton1" CssClass="btn btn-primary" runat="server" 
            onclick="LinkButton1_Click"><i class="icon-user"></i> Assign</asp:LinkButton>
            <br />
            <p class="text-error">
                <asp:Label ID="msgLabel" runat="server" Text=""></asp:Label></p>
    </div>

</asp:Content>

